﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExampleModule_cpl.aspx.cs" Inherits="DwProjectTemplate.CustomModules.ExampleModule.ExampleModule_cpl" %>
<%@ Register Assembly="Dynamicweb.Controls" Namespace="Dynamicweb.Controls" TagPrefix="dw" %>
<%@ Import Namespace="Dynamicweb" %>
<%@ Import Namespace="Dynamicweb.Backend" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link rel="STYLESHEET" type="text/css" href="/Admin/Stylesheet.css" />

	<script type="text/javascript">
		function selectGroups() {
			for (i = 0; i < document.forms[0].elements['Group'].options.length; i++) {
				document.forms[0].elements['Group'].options[i].selected = true;
			}
			for (i = 0; i < document.forms[0].elements['SecurityGroup'].options.length; i++) {
				document.forms[0].elements['SecurityGroup'].options[i].selected = true;
			}

		}
		window.onload = function () {
			img = "<img src=\"/admin/access/ExtranetGroup_closed.gif\" border=\"0\" align=\"absmiddle\" />";

			if (document.forms[0].elements['Group'].options.length > 0) {
				for (i = 0; i < document.forms[0].elements['Group'].options.length; i++) {
					txt = document.forms[0].elements['Group'].options[i].innerText;
					document.getElementById("Group_div").innerHTML += img + " " + txt + "<br/>";
				}
			}

			if (document.forms[0].elements['SecurityGroup'].options.length > 0) {
				txt = document.forms[0].elements['SecurityGroup'].options[0].innerText;
				document.getElementById("SecurityGroup_div").innerHTML = img + " " + txt;
			}
		}
	</script>

</head>
<body>
	<form id="Form1" name="Form1" runat="server" method="post" onsubmit="selectGroups()">
	<asp:ScriptManager ID="ScriptManager1" runat="server">
	</asp:ScriptManager>
	<%=Gui.MakeHeaders( "Example Module Settings" , "Example Module Settings", "all", true, "" )%>
	<table border="0" cellpadding="0" cellspacing="0" class="tabTable" style="width: 512px;">
		<tr>
			<td>
				<script type="text/javascript" src="/Admin/Extensibility/JavaScripts/UserSelector.js"></script>
				<dw:GroupBoxStart ID="GroupBoxStart1" runat="server" Title="Extranet Security Group settings" />
				<table cellpadding="2" cellspacing="0" border="0">
					<thead>
						<tr>
							<td colspan="2">
								Group settings
							</td>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>
								Security Group
							</td>
							<td>
								<div name="Group_div" id="Group_div" style="overflow: auto;
									width: 150px; height: 22px; border: solid #7F9DB9 1px; float: left;">
								</div>
								<select name="Group" id="Group" multiple="true" runat="server" size="4" style="width: 125px;
									display: none;">
								</select>
								<img src="/Admin/Images/eCom/group_add.gif" align="absMiddle" class="H" alt="Choose user/group"
									style="margin-bottom: 4px; margin-top: 4px;" onclick="window.open('/Admin/Module/eCom_Catalog/Lists/EcomUserTree.aspx?caller=opener.document.Form1.Group','','width=460,height=400,scrollbars=no,status=yes');" />
								&nbsp;
								<img src="/Admin/Images/eCom/group_delete.gif" align="absMiddle" class="H" alt="Delete user/group"
									style="margin-bottom: 4px;" onclick="deleteSelected('Group');" />
							</td>
						</tr>
						<tr>
							<td>
								Security Group
							</td>
							<td>
								<div name="SecurityGroup_div" id="SecurityGroup_div" style="overflow: auto;
									width: 150px; height: 22px; border: solid #7F9DB9 1px; float: left;">
								</div>
								<select name="SecurityGroup" id="SecurityGroup" multiple="true" runat="server" size="4"
									style="width: 125px; display: none;">
								</select>
								<img src="/Admin/Images/eCom/group_add.gif" align="absMiddle" class="H" alt="Choose user/group"
									style="margin-bottom: 4px; margin-top: 4px;" onclick="window.open('/Admin/Module/eCom_Catalog/Lists/EcomUserTree.aspx?caller=opener.document.Form1.SecurityGroup','','width=460,height=400,scrollbars=no,status=yes');" />
								&nbsp;
								<img src="/Admin/Images/eCom/group_delete.gif" align="absMiddle" class="H" alt="Delete user/group"
									style="margin-bottom: 4px;" onclick="deleteSelected('SecurityGroup');" />
							</td>
						</tr>
					</tbody>
				</table>
				<dw:GroupBoxEnd ID="GroupBoxEnd1" runat="server" />
				<dw:GroupBoxStart Id="GroupBoxStart2" runat="server" Title="Ajax loader for Settings" />
					<asp:UpdatePanel ID="UpdatePanel1" runat="server">
						<ContentTemplate>
							<asp:Button ID="btnLoadEcomGroups" runat="server" CssClass="buttonSubmit" Text="Load all ecom groups" onclick="btnLoadEcomGroups_Click" />
							<asp:DropDownList ID="lstEcomGroups" runat="server" Visible="false" CssClass="std"></asp:DropDownList>
							<asp:UpdateProgress ID="UpdateProgress5" DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0" runat="server">
								<ProgressTemplate>
									<img src="ajax-loader.gif" alt="Loading ..." />
								</ProgressTemplate>
							</asp:UpdateProgress>
						</ContentTemplate>
					</asp:UpdatePanel>
				<dw:GroupBoxEnd id="GroupBoxEnd2" runat="server" />
				<p style="text-align: right;">
					<asp:Button ID="btnSave" CssClass="ButtonSubmit" Text="OK" OnClick="btnSave_Click"
						runat="server" />
					<input type="button" name="ClosePage" class="ButtonSubmit" onclick="location.href='../../Admin/Module/ControlPanel.aspx';return false;"
						value="Cancel" />
				</p>
			</td>
		</tr>
	</table>
	</form>
</body>
</html>
<%
	Translate.GetEditOnlineScript();
%>